import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
//导入全局样式表
import './assets/css/global.css'
import axios from 'axios'
import TreeTable from 'vue-table-with-tree-grid'

axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/' //定义根路径
//为axios添加拦截器
axios.interceptors.request.use(config =>{
  console.log(config);
  config.headers.Authorization = window.sessionStorage.getItem('token');
  return config;//最后必须返回config
})
Vue.prototype.$http = axios //在原型链上给$http赋值为axios对象
//https://lianghj.top:8888/api/private/v1/
//http://127.0.0.1:8888/api/private/v1/
Vue.config.productionTip = false

Vue.component('tree-table',TreeTable);
 
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')